package com.henry.db.migrate.main;

import org.apache.log4j.Logger;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class InitialSourceDataClient {
    private static final Logger logger = Logger.getLogger(InitialSourceDataClient.class);
    public static void main(String[] args) throws Exception{
        logger.info("程序开始运行");
        ExecutorService threadPool = Executors.newFixedThreadPool(200);
        for (int i = 0; i < 200; i++) {
            InitialSourceDataThread thread = new InitialSourceDataThread(i);
            threadPool.execute(thread);
        }
        threadPool.shutdown();
        while (true) {
            if (threadPool.isTerminated()) {
                logger.info("全部子线程执行完毕");
                break;
            }
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        logger.info("程序运行结束");
    }

}
